import { extend, configure } from 'vee-validate'
import { required, email, min, max, length, confirmed, ext } from 'vee-validate/dist/rules'
//导入i18n.js抛出函数
import {i18n} from './i18n'

//配置
configure({
  defaultMessage:(field,values)=>{
    values._field_=i18n.t(`fields.${field}`)
    return i18n.t(`validation.${values._rule_}`,values)
  }
})

extend('email',email)
extend('min',min)
extend('max',max)
extend('required',required)
extend('length',length)
extend('confirmed',confirmed)